<template>
  <van-search v-model="value" show-action placeholder="请输入搜索关键词" @search="onSearch">
    <template #action>
      <div @click="onSearch">搜索</div>
    </template>
  </van-search>
  <!-- 遍历轮播图 -->
  <van-swipe :autoplay="3000" lazy-render>
    <van-swipe-item v-for="image in imagesArr" :key="image.bannerid">
      <img :src="image.img" class="lunbo-item" />
    </van-swipe-item>
  </van-swipe>
</template>

<script setup>
import { ref } from 'vue'
import { getLunbo } from '@/api/lunbo'
import { useRouter } from 'vue-router'
let imagesArr = ref([])
//导航搜索跳转
let value = ref('')
let router = useRouter()
function onSearch() {
  console.log(value.value)
  // router.push('/search?keyword=' + value.value)
}
// 轮播图
async function getLunboList() {
  let r = await getLunbo()
  console.log(r.data)
}
getLunboList()
</script>

<style></style>
